package com.yixun.qfbao.job;

import com.yixun.qfbao.service.CommissionRulesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
*@Author sangtao
*@Date 2017/10/28
* 周期计算佣金规则开始时间，结束时间，每日00：00：00开始执行
**/

public class SetCommissionRuleTimeJob {
    private static Logger logger = LoggerFactory.getLogger(SetCommissionRuleTimeJob.class);
    @Autowired
    private CommissionRulesService commissionRulesService;
    public void setCommissionRuleTime(){
        logger.info("设置佣金规则开始，结束时间job start.........");
        Integer count = commissionRulesService.setCommissionRuleTime();
        logger.info(count.toString() + "条规则设置开始时间结束时间");
        logger.info("设置佣金规则开始，结束时间job end.........");
    }

    //修改佣金状态
    public void setCommissionRuleState(){
        logger.info("修改佣金状态开始，job sart...................");
        Integer count =commissionRulesService.setCommissionRuleState();
        logger.info(count.toString() + "条规则设置为失效");
        logger.info("修改佣金状态结束，job end...................");
    }
}
